var obj = {
  name: "yz",
  age: 10,
  _address: "beijing"
}

// 存取属性描述符
// 1.隐藏某个私有变量
// 2.希望某一个属性它访问和设置值的过程时，也会使用get、set函数
Object.defineProperty(obj, "address", {
  // 配置
  enumerable: true,
  configurable: true,
  get: function() {
    this._address
  },
  set: function(value) {
    this._address = value
  }

})
console.log(obj._address);
obj._address = "shanghai"

console.log(obj._address);